<template>
  <div id="commerce">
    <div class="title-wrapper"><div class="pro">产品详情</div></div>
    <div style=" padding: 20px; display: flex; background-color: #fff;">
      <div class="message">
        <h1>那些企业要进行工商年报？</h1>
        <p>只要在工商部门进行注册登记的市场主体都需要进行年报，包括个体工商户和企业</p>
      </div>

      <div class="product">
        <h1>{{item.name}}</h1>
        <div style="color: red;font-size: 25px">${{item.price}}</div>
        <el-button type="primary"
                   @click="purchase"
                   style="width: 150px;margin-top: 20px">购买</el-button>
      </div>
    </div>

  </div>

</template>

<script>
  export default {
    name: "CommerceReport",
    data(){
      return{
        item:{
          name:'工商年报',
          price : 899
        },
        form:{}
      }
    },
    methods: {
      purchase() {
        if (sessionStorage.getItem('isLogin') === '0') {
          this.$router.push('/login')
        } else if (sessionStorage.getItem('userType') == 'server') {
          alert('您当前登录身份为服务方，无法下单。如需下单请退出系统使用采买方身份登录！')
        } else {
          this.form.ber_id = this.$store.getters.getInfo.ber_id
          this.form.or_kind = 1
          this.form.or_product = this.item.name
          this.form.or_money = this.item.price
          this.form.ser_id = ''
          this.form.or_pay = 0
          this.form.or_url = ''

          this.$router.push({
            name: 'Pay',
            params: {
              form: this.form
            }
          })
        }
      }
    }
  }
</script>

<style scoped>
  .pro{
    background-color: #ffffff;
    width: 200px;
    height: 40px;
    border-top: 4px solid #0d6eb8;
    color: #0d6eb8;
    font-size: 18px;
    line-height: 40px;
  }
  .message{
    text-align: left;
  }
  .message p{
    margin-top: 50px;
  }

  .product{
    box-sizing: border-box;
    width: 400px;
    height: 400px;
    padding: 20px;
    text-align: left;
    margin: 10px auto;
    background: url("../../../assets/images/工商报.png") no-repeat 200px 0;
    background-size: 400px;
    /*background-color: #cadef3;*/
    border: 1px solid #c7c4c4;
    box-shadow: 0 0 5px #a3a1a1;
  }
</style>